package com.app.base.service.file.controller;


import com.app.base.service.file.service.FileService;
import com.app.base.utlis.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;


@RestController
@RequestMapping("fileController")
@Api(tags = "文件管理")
public class FileController {

    @Resource
    private FileService fileService;

    @ApiOperation("OSS文件存储")
    @PostMapping("oss")
    public String uploadOssFile(MultipartFile file){
        return fileService.uploadFileAvatar(file);
    }

    @ApiOperation("腾讯云对象存储")
    @PostMapping("upload")
    public Result upload(MultipartFile file) {
        return fileService.upload(file);
    }

}
